package avatar

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type AvatarRouter struct {
}

// InitAvatarRouter 初始化 Avatar 路由信息
func (s *AvatarRouter) InitAvatarRouter(Router *gin.RouterGroup) {
	avatarRouter := Router.Group("avatar").Use(middleware.OperationRecord())
	avatarRouterWithoutRecord := Router.Group("avatar")
	var avatarApi = v1.ApiGroupApp.AvatarApiGroup.AvatarApi
	{
		avatarRouter.POST("createAvatar", avatarApi.CreateAvatar)             // 新建Avatar
		avatarRouter.DELETE("deleteAvatar", avatarApi.DeleteAvatar)           // 删除Avatar
		avatarRouter.DELETE("deleteAvatarByIds", avatarApi.DeleteAvatarByIds) // 批量删除Avatar
		avatarRouter.PUT("updateAvatar", avatarApi.UpdateAvatar)              // 更新Avatar

		avatarRouter.GET("", avatarApi.Avatar)
	}
	{
		avatarRouterWithoutRecord.GET("findAvatar", avatarApi.FindAvatar)       // 根据ID获取Avatar
		avatarRouterWithoutRecord.GET("getAvatarList", avatarApi.GetAvatarList) // 获取Avatar列表
	}
}
